<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<!-- 作业1，求1+2+...100=和; -->
		<script type="text/javascript">
			for (var a = 0; a <= 100; a++) {
				var sum = 0;
				sum += a;
			}
			console.log(sum)
		</script>
		<!-- 作业2，求1-100之间,既是3的倍数又是5的倍数; -->
		<script type="text/javascript">
			for (var a1 = 0; a1 <= 100; a1++) {
				if (a1 % 3 == 0 && a1 % 5 == 0) {
					console.log(a1)
				}
			} 
		</script>
		<!-- 作业3，求一下的值0+5，1+4，2+3，3+2，4+1，5+0 -->
		<script type="text/javascript">
			var a2 = 0,
				a3 = 5,
				sum;
			for (var i = 0; i <= 5; i++) {
				sum = a2 + a3;
				a2++;
				a3--;
				console.log(sum)
			}
		</script>
		<!-- 作业4，求2,-4,6,-8....n,求第n个值是多少? -->
		<script type="text/javascript">
			var num = prompt("想知道第几个数", )
			if (num% 2 == 0 ) {
				num = num * 2
				console.log("第n个数的值是：",num)
			} else{
				num = num * -2
				console.log("第n个数的值是：",num)
			}
		</script>
	</head>
	<body>
	</body>
</html>
